package jpsearchcore;

public class SourceElement{
	
	private String SourceElementTitle = "";
	private String SourceElementDescription = "";
	private String SourceElementIdentifier = "";
	
	public SourceElement(){}
	
	public SourceElement(String sourceElementTitle,
			String sourceElementDescription, String sourceElementIdentifier) {
		SourceElementTitle = sourceElementTitle;
		SourceElementDescription = sourceElementDescription;
		SourceElementIdentifier = sourceElementIdentifier;
	}

	public SourceElement(jpsearchcore.SourceType.SourceElement se ){
		try{
			SourceElementTitle = se.getSourceElementTitle().trim();
		}
		catch(NullPointerException e){}	
		////
		try{
			SourceElementDescription = se.getSourceElementDescription().trim();
		}
		catch(NullPointerException e){}	
		/////
		try{
			SourceElementIdentifier = se.getSourceElementIdentifier().trim();
		}
		catch(NullPointerException e){}	
	}
	
	public String getSourceElementTitle() {
		return SourceElementTitle;
	}

	public String getSourceElementDescription() {
		return SourceElementDescription;
	}

	public String getSourceElementIdentifier() {
		return SourceElementIdentifier;
	}
	
	//Setters
	public void setSourceElementTitle(String sourceElementTitle) {
		SourceElementTitle = sourceElementTitle;
	}

	public void setSourceElementDescription(String sourceElementDescription) {
		SourceElementDescription = sourceElementDescription;
	}

	public void setSourceElementIdentifier(String sourceElementIdentifier) {
		SourceElementIdentifier = sourceElementIdentifier;
	}

	public String toString(){
		String output = "\tSourceElement: [";
		output += "\n\t\t\tSourceElementTitle: " + SourceElementTitle;
		output += "\n\t\t\tSourceElementDescription: " + SourceElementDescription;
		output += "\n\t\t\tSourceElementIdentifier: " + SourceElementIdentifier;
		output += "\n\t\t]";
		return output;
	}
}
